package com.tqjc.system.common.enums;

import com.tqjc.system.common.constant.AddTaskConstant;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

/**
 * @author 86195
 * @version 1.0
 * @description 天车操作类型枚举
 * @date 2023/11/13 19:41
 */
@NoArgsConstructor
@AllArgsConstructor
@Getter
public enum CarOptTypeEnum {

    WASTE_STEEL_SUCK(new Object[]{"M13.1",0,"吸料任务完成"}, AddTaskConstant.WASTE_STEEL_SPAN_NO,AddTaskConstant.CAR_TASK_TYPE_SUCK,"废钢跨吸料任务完成"),
    WASTE_STEEL_PUT(new Object[]{"M13.2",0,"放料任务完成"},AddTaskConstant.WASTE_STEEL_SPAN_NO,AddTaskConstant.CAR_TASK_TYPE_PUT,"废钢跨放料任务完成"),
    WASTE_STEEL_MOVE(new Object[]{"M13.3",0,"避让任务完成"},AddTaskConstant.WASTE_STEEL_SPAN_NO,AddTaskConstant.CAR_TASK_TYPE_MOVE,"废钢跨避让任务完成"),
    DREGS_SUCK(new Object[]{"M7.3",0,"吸料任务完成"},AddTaskConstant.DREGS_STEEL_SPAN_NO,AddTaskConstant.CAR_TASK_TYPE_SUCK,"渣跨吸料任务完成"),
    DREGS_PUT(new Object[]{"M7.4",0,"放料任务完成"},AddTaskConstant.DREGS_STEEL_SPAN_NO,AddTaskConstant.CAR_TASK_TYPE_PUT,"渣跨放料任务完成"),
    DREGS_MOVE(new Object[]{"M7.5",0,"避让任务完成"},AddTaskConstant.DREGS_STEEL_SPAN_NO,AddTaskConstant.CAR_TASK_TYPE_MOVE,"渣跨避让任务完成");

    /**
     * 任务执行标识  地址/数据类型/label
     */
    private Object[] PLCArray;

    private String spanNo;

    private String optType;

    private String desc;



    public static CarOptTypeEnum getEnum(String spanNo,String optType){
        for (CarOptTypeEnum value : CarOptTypeEnum.values()) {
            if(value.optType.equals(optType) && value.getSpanNo().equals(spanNo)){
                return value;
            }
        }
        return null;
    }


}
